package xcmg.device.dao.mapper.threeGuaranteesPur;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import xcmg.device.dao.entity.threeGuaranteesPur.ThreeGuaranteesPurDO;
import xcmg.device.service.vo.threeGuaranteesPur.ThreeGuaranteesPurExportVO;
import xcmg.device.service.vo.threeGuaranteesPur.ThreeGuaranteesPurVO;

import java.util.List;

@Mapper
public interface ThreeGuaranteesPurMapper {
    int delete(String id);

    int add(ThreeGuaranteesPurDO record);

    int update(ThreeGuaranteesPurDO record);
    
    int revert(String id);

    int remove(@Param("ids") List<String> ids);

    ThreeGuaranteesPurDO item(String id);

    ThreeGuaranteesPurDO itemByNo(@Param("purchaseNo") String purchaseNo, @Param("orgId") String orgId);

    List<ThreeGuaranteesPurDO> list(ThreeGuaranteesPurVO model);

    int findCountForExportAll(ThreeGuaranteesPurVO model);

    Integer checkPendingCount(@Param("orgId")String orgId);

    List<ThreeGuaranteesPurDO> findByIds(@Param("ids")List<String> ids);

    int findForDeleteByIds(@Param("billNos")List<String> billNos, @Param("orgId") String orgId);

    List<String> findBillNos(@Param("ids")List<String> ids);

    List<ThreeGuaranteesPurDO> selectByCrmOrder(@Param("crmOrder") String crmOrder);

    Integer countByCrmOrder(@Param("crmOrder") String crmOrder);

    Integer updateDeliveryReceiptByBillNo(List<ThreeGuaranteesPurDO> threeGuaranteesPurDOList);

    List<ThreeGuaranteesPurDO> findByBillNo(@Param("billNo") String billNo);

    Integer updateByCrmOrder(ThreeGuaranteesPurDO threeGuaranteesPurDO);

    List<ThreeGuaranteesPurDO> listByInstructionCode(@Param( "instructionCode" ) String instructionCode, @Param( "orgId" ) String orgId);

    List<ThreeGuaranteesPurExportVO> exportData(ThreeGuaranteesPurVO condition);

    List<ThreeGuaranteesPurExportVO> exportByIds(@Param("ids")List<String> ids,@Param("warehouseCode") String warehouseCode);
}
